Parallelization of the Parser

~66% reduction (unoptimized build)
~30% reduction (optimized build)
This commit is contained in:
Ginger Bill
2017-07-30 19:01:02 +01:00
parent 62a72f0163
commit 629b248f53
7 changed files with 312 additions and 130 deletions
+9 -5
View File
@@ -338,7 +338,7 @@ union_type :: proc() {
parametric_polymorphism :: proc() {
print_value :: proc(value: $T) {
fmt.printf("print_value: %v %v\n", value, value);
fmt.printf("print_value: %T %v\n", value, value);
}
v1: int = 1;
@@ -496,10 +496,12 @@ parametric_polymorphism :: proc() {
return -1;
}
get_hash :: proc(s: string) -> u32 { // djb2
hash: u32 = 0x1505;
for i in 0..len(s) do hash = (hash<<5) + hash + u32(s[i]);
return hash;
get_hash :: proc(s: string) -> u32 { // fnv32a
h: u32 = 0x811c9dc5;
for i in 0..len(s) {
h = (h ~ u32(s[i])) * 0x01000193;
}
return h;
}
@@ -586,6 +588,7 @@ threading_example :: proc() {
main :: proc() {
when false {
if true {
fmt.println("\ngeneral_stuff:"); general_stuff();
fmt.println("\nnested_struct_declarations:"); nested_struct_declarations();
@@ -595,4 +598,5 @@ main :: proc() {
}
fmt.println("\nthreading_example:"); threading_example();
}
}