Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Programmers' lounge. (Programming-related discussions only)
New Posts  All Forums:Forum Nav:

Programmers' lounge. (Programming-related discussions only) - Page 82

post #811 of 1143
I need (again) help in running on some fast machine (3rd/4th generation i7, Vishera or alike) my latest fastest MEMMEM function:
http://www.codeproject.com/Articles/250566/Fastest-strstr-like-function-in-C

My wish is to compare results on my laptop 'Bonboniera' with next generation CPUs.
The idea is more people to see how the beautiful Boyer-Moore-Horspool algorithm reigning since 1980 now is replaced by its successor 'Railgun_Bari' and what is the actual boost.

All high-level languages use BMH code, in my view it is time for change.

EDIT:
For those who have will to run the benchmark, here are the 2 steps:

- downloading the benchmark at http://www.sekireigan.com/_KAZE_32bit_memmem-like_showdown.7z
- run 'RUNME_WIKI_memmem.BAT', it creates 'Results.txt' - that's the goal.

I wanted the stats to be more accurate therefore I increased the trials so that even very fast CPUs to have some job to do.
The benchmark stresses CPU-RAM subsystem, CPU clock and fetching uncached main RAM small chunks (4-12 bytes) are responsible for speed performance.
Edited by Sanmayce - 10/21/13 at 9:07am
post #812 of 1143
Been messing wit shell scripting, and with my two days off I converted it to python and perl.biggrin.gif
Edited by andyroo89 - 11/1/13 at 1:41am
Collecting Dust
(13 items)
 
Server
(9 items)
 
 
CPUMotherboardGraphicsRAM
E8400 3.0ghz OC @ 3.8GHz @ 1.36v DFI BLood Iron P35 none OCZ 2x 2gb DDR2 800 CAS @ 5-6-6-21 
Hard DriveOptical DriveOSMonitor
none none loonix ssh is my monitor 
KeyboardPowerCaseMouse
none Corsair 650 watts old pc case Logitech mx518 
Mouse Pad
none! 
CPUMotherboardGraphicsRAM
AMD Athlon 64 X2 Dual Core Processor 6000+ GX611AA-ABA m8300f onboard 1x 2GB OCZ RAM DDR 
Hard DriveOSMonitorPower
320gb + 1TB HDD xubuntu 14.04 SSH 350 watt 
Case
crappy HP case 
  hide details  
Reply
Collecting Dust
(13 items)
 
Server
(9 items)
 
 
CPUMotherboardGraphicsRAM
E8400 3.0ghz OC @ 3.8GHz @ 1.36v DFI BLood Iron P35 none OCZ 2x 2gb DDR2 800 CAS @ 5-6-6-21 
Hard DriveOptical DriveOSMonitor
none none loonix ssh is my monitor 
KeyboardPowerCaseMouse
none Corsair 650 watts old pc case Logitech mx518 
Mouse Pad
none! 
CPUMotherboardGraphicsRAM
AMD Athlon 64 X2 Dual Core Processor 6000+ GX611AA-ABA m8300f onboard 1x 2GB OCZ RAM DDR 
Hard DriveOSMonitorPower
320gb + 1TB HDD xubuntu 14.04 SSH 350 watt 
Case
crappy HP case 
  hide details  
Reply
post #813 of 1143
It's a shame this thread's become so lifeless; I would've enjoyed seeing it back when it was active. Does anyone know any active (>5 posts per day ) programming-related threads on OCN?
post #814 of 1143
The programming competition threads are pretty fun reads.
Bandaids
(15 items)
 
  
MotherboardGraphicsHard DriveOptical Drive
Asrock Z77 Extreme 6 GTX 580 WD 10EALX ASUS DRW 
CoolingOSMonitorMonitor
Havik 140 Windows 7 Ultimate ASUS VH228T Toshiba 32RV600A 
MonitorKeyboardPowerCase
Compaq S2021a Microsoft Wired Keyboard 600 Aero Cool Strike X 1100w Asus Antec 
MouseMouse PadAudio
Logitech MX518 Mionix Ensis 320 Creative 2.1 
  hide details  
Reply
Bandaids
(15 items)
 
  
MotherboardGraphicsHard DriveOptical Drive
Asrock Z77 Extreme 6 GTX 580 WD 10EALX ASUS DRW 
CoolingOSMonitorMonitor
Havik 140 Windows 7 Ultimate ASUS VH228T Toshiba 32RV600A 
MonitorKeyboardPowerCase
Compaq S2021a Microsoft Wired Keyboard 600 Aero Cool Strike X 1100w Asus Antec 
MouseMouse PadAudio
Logitech MX518 Mionix Ensis 320 Creative 2.1 
  hide details  
Reply
post #815 of 1143
Hello biggrin.gif Can you guys tell me if there is big real world difference between i7 and i5 in programming ? (compiling/etc?). I kinda guess visual studio for example will take advantage of more cores but I'm asking about programming as a whole thumb.gif
post #816 of 1143
Quote:
Originally Posted by robE View Post

Hello biggrin.gif Can you guys tell me if there is big real world difference between i7 and i5 in programming ? (compiling/etc?). I kinda guess visual studio for example will take advantage of more cores but I'm asking about programming as a whole thumb.gif

Meh. Not really. Maybe if your project is as huge as something like Firefox it might make a difference.
Ol' Sandy
(28 items)
 
"Zeus"
(12 items)
 
Elite Preview
(6 items)
 
CPUMotherboardGraphicsRAM
Intel Xeon E3-1230v3 Gigabyte GA-Z97X-UD5H-BK MSI Gaming GTX 980 Kingston 32GB (4x8) 
Hard DriveHard DriveHard DriveHard Drive
Plextor PX-256M5S 256GB Samsung EVO 1TB Hitachi HDS721010CLA332 Hitachi HDS723020BLA642 
Hard DriveHard DriveHard DriveOptical Drive
Hitachi HDS723020BLA642 Hitachi HUA722010CLA330 WDC WD10EARS-00Z5B1 TSSTcorp CDDVDW SH-S223B 
CoolingCoolingOSMonitor
Phanteks PH-TC14PE with TY-140's Lamptron FCv5 (x2) Windows 8 Pro 64-bit Dell U2412M 
MonitorMonitorMonitorKeyboard
Dell U2412M Dell U2212HM Dell U2713HM Topre Realforce 87UB | Ducky DK9087 G2 Pro 
PowerCaseMouseMouse Pad
Corsair AX-750 Corsair Obsidian 650D Logitech G700 XTRAC Ripper XXL 
AudioAudioAudioAudio
Beyerdynamic DT-770 Pro 250ohm Schiit Bifrost DAC Schiit Asgard 2 HiVi Swan M50W 2.1 
CPUMotherboardRAMHard Drive
Intel Xeon E5-2620 Super Micro X9SRL-F-B 128GB 1333MHz LSI 9271-8i 
OSPowerCase
VMware ESXi 5.5 SeaSonic SS-400FL2 Fractal Define R3 
CPUMotherboardGraphicsRAM
Intel Core i5-3437U HP EliteBook Folio 9470m  Intel HD Graphics 4000  16GB DDR3 SDRAM 
Hard DriveOS
256GB SSD Windows 10 Insider Preview 
  hide details  
Reply
Ol' Sandy
(28 items)
 
"Zeus"
(12 items)
 
Elite Preview
(6 items)
 
CPUMotherboardGraphicsRAM
Intel Xeon E3-1230v3 Gigabyte GA-Z97X-UD5H-BK MSI Gaming GTX 980 Kingston 32GB (4x8) 
Hard DriveHard DriveHard DriveHard Drive
Plextor PX-256M5S 256GB Samsung EVO 1TB Hitachi HDS721010CLA332 Hitachi HDS723020BLA642 
Hard DriveHard DriveHard DriveOptical Drive
Hitachi HDS723020BLA642 Hitachi HUA722010CLA330 WDC WD10EARS-00Z5B1 TSSTcorp CDDVDW SH-S223B 
CoolingCoolingOSMonitor
Phanteks PH-TC14PE with TY-140's Lamptron FCv5 (x2) Windows 8 Pro 64-bit Dell U2412M 
MonitorMonitorMonitorKeyboard
Dell U2412M Dell U2212HM Dell U2713HM Topre Realforce 87UB | Ducky DK9087 G2 Pro 
PowerCaseMouseMouse Pad
Corsair AX-750 Corsair Obsidian 650D Logitech G700 XTRAC Ripper XXL 
AudioAudioAudioAudio
Beyerdynamic DT-770 Pro 250ohm Schiit Bifrost DAC Schiit Asgard 2 HiVi Swan M50W 2.1 
CPUMotherboardRAMHard Drive
Intel Xeon E5-2620 Super Micro X9SRL-F-B 128GB 1333MHz LSI 9271-8i 
OSPowerCase
VMware ESXi 5.5 SeaSonic SS-400FL2 Fractal Define R3 
CPUMotherboardGraphicsRAM
Intel Core i5-3437U HP EliteBook Folio 9470m  Intel HD Graphics 4000  16GB DDR3 SDRAM 
Hard DriveOS
256GB SSD Windows 10 Insider Preview 
  hide details  
Reply
post #817 of 1143
So today a mate in 4th year in CS told me that C is faster than C++(I used to think that C++ is the fastest language :/)is this true?how much faster?why is it faster?
My First
(9 items)
 
My dream
(7 items)
 
 
CPUMotherboardGraphicsGraphics
i7 4960x ASUS Rampage IV Extreme Black Edition GTX 780 ti GTX 780 ti 
GraphicsRAMHard Drive
GTX 780 ti  64 GB corsair dominator Samsung 840 pro 256GB SSD 
  hide details  
Reply
My First
(9 items)
 
My dream
(7 items)
 
 
CPUMotherboardGraphicsGraphics
i7 4960x ASUS Rampage IV Extreme Black Edition GTX 780 ti GTX 780 ti 
GraphicsRAMHard Drive
GTX 780 ti  64 GB corsair dominator Samsung 840 pro 256GB SSD 
  hide details  
Reply
post #818 of 1143
Quote:
Originally Posted by ABD EL HAMEED View Post

So today a mate in 4th year in CS told me that C is faster than C++(I used to think that C++ is the fastest language :/)is this true?how much faster?why is it faster?

IIRC, it has to do with the way C++ sets up memory usage/access and C sets up memory usage/access.

Since C++ is object oriented, the functions and variables are behind an object which requires memory access to use the object. In C++, you are not always guaranteed to efficiently use this memory space.

In C however, memory access/usage/mapping is very well understood, optimized, and presented in a more straight forward fashion. Because of this, most people when coding in C are already programming in a way that can utilize the CPUs cache more efficiently which greatly speeds up memory access and allows the CPU to be working more of the time.


* discalimer: This is what I remember when I looked into why the Linux kernel is programmed in C and not C++ when there are a lot of constructs in the kernel that exhibit object oriented philosophies. I could also be very wrong here as well, but this is what I understand of the differences.
Router
(12 items)
 
  
Reply
Router
(12 items)
 
  
Reply
post #819 of 1143
Quote:
Originally Posted by stumped View Post

IIRC, it has to do with the way C++ sets up memory usage/access and C sets up memory usage/access.

Since C++ is object oriented, the functions and variables are behind an object which requires memory access to use the object. In C++, you are not always guaranteed to efficiently use this memory space.

In C however, memory access/usage/mapping is very well understood, optimized, and presented in a more straight forward fashion. Because of this, most people when coding in C are already programming in a way that can utilize the CPUs cache more efficiently which greatly speeds up memory access and allows the CPU to be working more of the time.


* discalimer: This is what I remember when I looked into why the Linux kernel is programmed in C and not C++ when there are a lot of constructs in the kernel that exhibit object oriented philosophies. I could also be very wrong here as well, but this is what I understand of the differences.

Well that explains a lot,thanks!

But how much faster is C?
My First
(9 items)
 
My dream
(7 items)
 
 
CPUMotherboardGraphicsGraphics
i7 4960x ASUS Rampage IV Extreme Black Edition GTX 780 ti GTX 780 ti 
GraphicsRAMHard Drive
GTX 780 ti  64 GB corsair dominator Samsung 840 pro 256GB SSD 
  hide details  
Reply
My First
(9 items)
 
My dream
(7 items)
 
 
CPUMotherboardGraphicsGraphics
i7 4960x ASUS Rampage IV Extreme Black Edition GTX 780 ti GTX 780 ti 
GraphicsRAMHard Drive
GTX 780 ti  64 GB corsair dominator Samsung 840 pro 256GB SSD 
  hide details  
Reply
post #820 of 1143
Quote:
Originally Posted by ABD EL HAMEED View Post

Well that explains a lot,thanks!

But how much faster is C?

Eh.

In C++, "you only pay for what you use." So there is nothing that would make it any slower than C. In particular for scientific programs, template expressions make it possible to perform some custom optimization using the template engine to process program semantics. Well written code in any language is always better than poorly written code in any other language.

I don't think that the reason is so much related to performance as it is to interoperability. The C++ language is more complex than the C language, but from a performance point of view there shouldn't be a notable difference in either way. Some C++ constructs are faster than the C equivalent (std::sort is faster than qsort) and there are probably good examples of the other way around.

C++ may be slower if you use its more advanced features but you have to ask yourself if you are micro-optimizing or if there really is a bottleneck.

I think your mate is in fairy land if he is going around saying C is definitely faster than C++. The same code in either language will have zero difference in speed and in some cases C++ can be faster depending on what you do, just like C can be as well.
Ol' Sandy
(28 items)
 
"Zeus"
(12 items)
 
Elite Preview
(6 items)
 
CPUMotherboardGraphicsRAM
Intel Xeon E3-1230v3 Gigabyte GA-Z97X-UD5H-BK MSI Gaming GTX 980 Kingston 32GB (4x8) 
Hard DriveHard DriveHard DriveHard Drive
Plextor PX-256M5S 256GB Samsung EVO 1TB Hitachi HDS721010CLA332 Hitachi HDS723020BLA642 
Hard DriveHard DriveHard DriveOptical Drive
Hitachi HDS723020BLA642 Hitachi HUA722010CLA330 WDC WD10EARS-00Z5B1 TSSTcorp CDDVDW SH-S223B 
CoolingCoolingOSMonitor
Phanteks PH-TC14PE with TY-140's Lamptron FCv5 (x2) Windows 8 Pro 64-bit Dell U2412M 
MonitorMonitorMonitorKeyboard
Dell U2412M Dell U2212HM Dell U2713HM Topre Realforce 87UB | Ducky DK9087 G2 Pro 
PowerCaseMouseMouse Pad
Corsair AX-750 Corsair Obsidian 650D Logitech G700 XTRAC Ripper XXL 
AudioAudioAudioAudio
Beyerdynamic DT-770 Pro 250ohm Schiit Bifrost DAC Schiit Asgard 2 HiVi Swan M50W 2.1 
CPUMotherboardRAMHard Drive
Intel Xeon E5-2620 Super Micro X9SRL-F-B 128GB 1333MHz LSI 9271-8i 
OSPowerCase
VMware ESXi 5.5 SeaSonic SS-400FL2 Fractal Define R3 
CPUMotherboardGraphicsRAM
Intel Core i5-3437U HP EliteBook Folio 9470m  Intel HD Graphics 4000  16GB DDR3 SDRAM 
Hard DriveOS
256GB SSD Windows 10 Insider Preview 
  hide details  
Reply
Ol' Sandy
(28 items)
 
"Zeus"
(12 items)
 
Elite Preview
(6 items)
 
CPUMotherboardGraphicsRAM
Intel Xeon E3-1230v3 Gigabyte GA-Z97X-UD5H-BK MSI Gaming GTX 980 Kingston 32GB (4x8) 
Hard DriveHard DriveHard DriveHard Drive
Plextor PX-256M5S 256GB Samsung EVO 1TB Hitachi HDS721010CLA332 Hitachi HDS723020BLA642 
Hard DriveHard DriveHard DriveOptical Drive
Hitachi HDS723020BLA642 Hitachi HUA722010CLA330 WDC WD10EARS-00Z5B1 TSSTcorp CDDVDW SH-S223B 
CoolingCoolingOSMonitor
Phanteks PH-TC14PE with TY-140's Lamptron FCv5 (x2) Windows 8 Pro 64-bit Dell U2412M 
MonitorMonitorMonitorKeyboard
Dell U2412M Dell U2212HM Dell U2713HM Topre Realforce 87UB | Ducky DK9087 G2 Pro 
PowerCaseMouseMouse Pad
Corsair AX-750 Corsair Obsidian 650D Logitech G700 XTRAC Ripper XXL 
AudioAudioAudioAudio
Beyerdynamic DT-770 Pro 250ohm Schiit Bifrost DAC Schiit Asgard 2 HiVi Swan M50W 2.1 
CPUMotherboardRAMHard Drive
Intel Xeon E5-2620 Super Micro X9SRL-F-B 128GB 1333MHz LSI 9271-8i 
OSPowerCase
VMware ESXi 5.5 SeaSonic SS-400FL2 Fractal Define R3 
CPUMotherboardGraphicsRAM
Intel Core i5-3437U HP EliteBook Folio 9470m  Intel HD Graphics 4000  16GB DDR3 SDRAM 
Hard DriveOS
256GB SSD Windows 10 Insider Preview 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Programmers' lounge. (Programming-related discussions only)